# Maintainer:
pkgname=shapelib
pkgver=1.6.0
pkgrel=0
pkgdesc="C library for reading, writing and updating ESRI Shapefiles, and the associated attribute file"
url="http://shapelib.maptools.org/"
arch="all"
license="LGPL-2.0-only OR MIT"
depends_dev="$pkgname=$pkgver-r$pkgrel"
subpackages="$pkgname-dev $pkgname-tools"
source="https://download.osgeo.org/shapelib/shapelib-$pkgver.tar.gz
	nobash.patch
	"
prepare() {
	default_prepare
	update_config_sub
}

build() {
	CFLAGS="$CFLAGS -flto=auto -O2" \
	./configure \
		--prefix=/usr \
		--host=$CHOST \
		--build=$CBUILD \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

tools() {
	pkgdesc="$pkgdesc (utilities)"

	amove usr/bin
}

sha512sums="
cc0b5841da5039c0467291994b9cd3aa99bebe70adf8db01719336a0eb2f0d7362395806f99228ba1f7ec68f0c5ecf9f7f5f1018093cf8dad9e06f0ae147c3fc  shapelib-1.6.0.tar.gz
5d0dd9665aa9755c34003d9a0ed859bda5ba194b05e40f4910536432832b4ed0274df210ddfd452116890388c585244ee02883f5c7b7095cd676e9a919799ef8  nobash.patch
"
